﻿<!DOCTYPE html>
<html><head>
  <title>Feature 的 Params 关键字</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=8">
  <meta name="generator" content="Help &amp; Manual">
  <meta name="keywords" content="">
  <meta name="description" content="The params keyword is used in two ways: To reference feature parameters and to declare them.A feature params is referenced from a featureblock to indicate the specified...">
  <link type="text/css" href="default.css" rel="stylesheet">
  <link type="text/css" href="custom.css" rel="stylesheet">
  <style type="text/css" media="screen">
      html,body { margin:0;
        padding:0;
       background: #ffffff;
      }
      div#printheader { display: none; }
      #idheader {
        width:100%;
        height:auto;
        padding: 0;
        margin: 0;
        position: fixed;
        top: 0;
        z-index: 2;
      }
      /* The "min-height" for "#idheader table" ensures that the (blue) header of the topic
         has at least the same height as the header of the navigation panel left of it */
      #idheader table {background: #2C5D88; min-height: 59px }
      #idheader h1 span { color: #FFF }
      #idnav {
        text-align: right;
        width: 126px;
        vertical-align: middle;
      }
      #idnav a { text-decoration: none }
      #idnav span {
        display: inline-block;
        width: 24px;
        height: 24px;
        margin-left: 4px;
       background:url('hm_webhelp_buttons_grey.png') top left no-repeat;
      }
      #idnav a span {
       background-image:url('hm_webhelp_buttons_white.png');
      }
      #idnav a span:hover {
       background-image:url('hm_webhelp_buttons_orange.png');
      }
      #idnav span.hmbtnprev {background-position: 0 -32px }
      #idnav span.hmbtnnext {background-position: -24px -32px }
      #idnav span.hmbtntop  {background-position: -48px -32px }
      #idnav span.hmbtntoggle  { width: 20px;background-position: -70px -32px }
      #idnav span.hmbtnprint  {background-position: -88px -32px }
      #callout-table, #overview-table {display:block; position:relative; top:0; left:0;}
      #callout-icon {display:block; position:absolute; top:-11px; left:-11px;}
      #callout-icon-flag {display:block; position:absolute; top:-11px; left:-8px;}
      #callout-table a {text-decoration: none; color:blue;}
      #callout-table a:visited {text-decoration: none; color:blue;}
      #overview-table a {text-decoration: none; color:black;}
      #overview-table a:visited {text-decoration: none; color:black;}
      #callout-table a:hover, #overview-table a:hover {text-decoration: underline;}
      p.help-url { margin: 20px 0 5px 0; text-align: center; font-size: 80%; text-decoration: none }
      #switchtoggles { text-align: right; padding: 0 2px 0 0; font-size: 90%; }
      .sync-toc { color: #FFF; font-size: 8pt; font-weight:bold; display: none; }
      .sync-toc a { color: #FFF; text-decoration: none; font-weight:bold;}
      .sync-toc a:visited { color: #FFF; }
      .sync-toc a:hover { text-decoration: underline; }
      a.hmanchor { display: inline-block; margin-top: -4em; padding-top: 4em }	
  </style>
  <style type="text/css" media="print">
      div#idheader, img.dropdown-toggle-icon, p.help-url { display:none }
  </style>
  <script type="text/javascript" src="jquery.js"></script>
  <script type="text/javascript" src="helpman_settings.js"></script>
  <script type="text/javascript" src="helpman_topicinit.js"></script>
</head>
<body>
<div id="printheader"><h1 class="p_Heading1" style="page-break-after: avoid;"><span class="f_Heading1">OpenType 布局特征 - Feature 的 Params 关键字</span></h1>
</div>
<div id="idheader" style="position: relative;">
<div id="idheaderbg">
<table style="width:100%;border:none;margin:0px;" cellspacing="0" cellpadding="0">
 <tbody><tr>
   <td class="topichead" style="text-align:left; vertical-align:bottom">
     <p class="crumbs"><b>导航：</b>&nbsp;编辑字体 &gt; 格式 &gt; OpenType 布局特征 &gt; 脚本编辑器 &gt; 脚本语法 OTLFD &gt;</p>
     <h1 class="p_Heading1" style="page-break-after: avoid;"><span class="f_Heading1">OpenType 布局特征 - Feature 的 Params 关键字</span></h1>
   </td>
   <td class="topichead" id="idnav">
     <a href="otlf_feature.html" title="上一主题"><span class="hmbtnprev"></span></a>
     <a href="welcometothefontcreator.html" title="返回首章"><span class="hmbtntop"></span></a>
     <a href="otlf_lookup.html" title="下一主题"><span class="hmbtnnext"></span></a>
   </td>
 </tr>
</tbody></table>
</div>
</div>
<div id="idcontent" style="margin-top: 0px;"><div id="innerdiv">
<!--ZOOMRESTART-->
<p class="p_Normal">关键字 params 有两种使用方式：引用特征参数和声明参数。在 feature(特征) 区块中对特征参数进行引用，表明所指定的特征参数在该特征中可用。</p>
<p class="p_Normal"><span style="font-weight:bold;">引用特征参数：</span></p>
<p class="p_Code"><span class="f_Code">feature CharacterVariants01_1 cv01 {</span></p>
<p class="p_Code"><span class="f_Code"> &nbsp;params FeatureParams_cv01;</span></p>
<p class="p_Code"><span class="f_Code">}</span></p>
<p class="p_Code"><span class="f_Code">&nbsp;</span></p>
<p class="p_Code"><span class="f_Code">feature OpticalSize1 size {</span></p>
<p class="p_Code"><span class="f_Code"> &nbsp;params FeatureParams_size;</span></p>
<p class="p_Code"><span class="f_Code">}</span></p>
<p class="p_Code"><span class="f_Code">&nbsp;</span></p>
<p class="p_Code"><span class="f_Code">feature StylisticSet1_1 ss01 {</span></p>
<p class="p_Code"><span class="f_Code"> &nbsp;params FeatureParams_ss01;</span></p>
<p class="p_Code"><span class="f_Code">}</span></p>
<p class="p_Code"><span class="f_Code">&nbsp;</span></p>
<p class="p_Code"><span class="f_Code">&nbsp;</span></p>
<p class="p_Normal"><span style="font-weight:bold;">声明特征参数：</span></p>
<p class="p_Normal">当前定义了三个特征参数：</p>
<p class="p_Normal">光学尺寸特征(size)使用了 sizeparams 参数：</p>
<p class="p_Code"><span class="f_Code">params FeatureParams_size sizeparams {</span></p>
<p class="p_Code"><span class="f_Code"> &nbsp;designsize 100; &nbsp; &nbsp; &nbsp; &nbsp;// 设计尺寸，以分点(decipoint)为单位 [译：大小为十分之一个点(磅)]</span></p>
<p class="p_Code"><span class="f_Code"> &nbsp;subfamily 3; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // 作为一个以子族形式关联起字体的标识符</span></p>
<p class="p_Code"><span class="f_Code"> &nbsp;range 80 120; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// 表示推荐使用的起止范围（不含起点值、含终点值），以分点为单位</span></p>
<p class="p_Code"><span class="f_Code"> &nbsp;name 1033 &quot;Content&quot;; &nbsp; // 字体的子族名</span></p>
<p class="p_Code"><span class="f_Code">}</span></p>
<p class="p_Code"><span class="f_Code">&nbsp;</span></p>
<p class="p_Normal">样式集特征(ss01-ss20)使用了 ssetparams 参数：</p>
<p class="p_Code"><span class="f_Code">params FeatureParams_ss01 ssetparams {</span></p>
<p class="p_Code"><span class="f_Code"> &nbsp;name 1033 &quot;Content for Stylisitc Set 1&quot;; &nbsp;// 指定用户界面标签的文本</span></p>
<p class="p_Code"><span class="f_Code">}</span></p>
<p class="p_Code"><span class="f_Code">&nbsp;</span></p>
<p class="p_Normal">字符变体特征(cv01-cv99)使用了 cvarparams 参数：</p>
<p class="p_Code"><span class="f_Code">params FeatureParams_cv01 cvarparams {</span></p>
<p class="p_Code"><span class="f_Code"> &nbsp;label {</span></p>
<p class="p_Code"><span class="f_Code"> &nbsp; &nbsp;name 1033 &quot;Capital-eng variants&quot;; &nbsp; &nbsp;// 指定用户界面标签文本</span></p>
<p class="p_Code"><span class="f_Code"> &nbsp;}</span></p>
<p class="p_Code"><span class="f_Code"> &nbsp;tooltip {</span></p>
<p class="p_Code"><span class="f_Code"> &nbsp; &nbsp;name 1033 &quot;Select glyph variants for capital eng.&quot;; &nbsp; &nbsp;// 指定信息提示文本</span></p>
<p class="p_Code"><span class="f_Code"> &nbsp;}</span></p>
<p class="p_Code"><span class="f_Code"> &nbsp;sampletext {</span></p>
<p class="p_Code"><span class="f_Code"> &nbsp; &nbsp;name 1033 &quot;Content for Sample Text&quot;; // 举例说明该特征效果的文本</span></p>
<p class="p_Code"><span class="f_Code"> &nbsp;}</span></p>
<p class="p_Code"><span class="f_Code"> &nbsp;variant {</span></p>
<p class="p_Code"><span class="f_Code"> &nbsp; &nbsp;name 1033 &quot;Content for Variant 1&quot;; &nbsp; // 指定变体1的文本</span></p>
<p class="p_Code"><span class="f_Code"> &nbsp; &nbsp;name 1033 &quot;Content for Variant 2&quot;; &nbsp; // 指定变体2的文本</span></p>
<p class="p_Code"><span class="f_Code"> &nbsp; &nbsp;name 1033 &quot;Content for Variant 3&quot;; &nbsp; // 指定变体3的文本</span></p>
<p class="p_Code"><span class="f_Code"> &nbsp;}</span></p>
<p class="p_Code"><span class="f_Code"> &nbsp;characters [70 80]; // 为其提供字形变体的字符代码点</span></p>
<p class="p_Code"><span class="f_Code">}</span></p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal"><span style="font-weight:bold;">name</span></p>
<p class="p_Normal">关键字 name 需要明确语言 ID 和文本。</p>
<p class="p_Normal"><span style="font-weight:bold;">语言 ID(Language ID)：</span>Windows 语言 ID 所支持的完整列表可以在此页面找到：<a href="https://www.microsoft.com/typography/otspec/name.htm" target="_blank" class="weblink">https://www.microsoft.com/typography/otspec/name.htm</a>。与许多值一样，语言 ID 可以用十进制或十六进制表示法给出。例如，要使用语言英语 - 美国，可以用 $409 或 1033 表示。</p>
<p class="p_Normal"><span style="font-weight:bold;">文本(Text)：</span>文本需要用双引号引起来，除非文本仅使用以下字符：a-z、A-Z、0-9。如果要在文本里面加入一个双引号，则需要添加两个双引号。</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_NoteorTip"><span class="f_NoteorTip">注意：与关键字 name 一起使用的语言 ID 与关键字 <a href="otlf_language.html" class="topiclink">language</a> 无关。</span></p>
<!--ZOOMSTOP-->
</div></div>
<script type="text/javascript">
  $(document).ready(function(){
    $(window).bind('resize', function() {
      var y = $('#idheader').height();
      $('#idcontent').css('margin-top', y);
      var par = window.parent;
      if ($( par ).width()<= $( window ).width()+20) {
        $('#idheader').css('position', 'relative');
        $('#idcontent').css('margin-top', 0);
        $('#idbacktotop').css('display', 'block');
        $('.hmanchor').css('margin-top', -20);
	$('.hmanchor').css('padding-top', 20);
      }
      else {
        $('#idheader').css('position', 'fixed');
        $('#idcontent').css('margin-top', $('#idheader').height());
        $('#idbacktotop').css('display', 'none');
        $('.hmanchor').css('margin-top', -y-20);
	$('.hmanchor').css('padding-top', y+20);
      }
    });
    $(window).resize(); //trigger event for initially small displays
  });
</script>
</body></html>